
<%@page import="qldc.pm.qlktcsdldc.service.NguoiDungLocalServiceUtil"%>
<%@page import="qldc.pm.qlktcsdldc.model.NguoiDung"%>
<%@page import="qldc.pm.qlktcsdldc.service.DanhMucSoBanNganhLocalServiceUtil"%>
<%@page import="qldc.pm.qlktcsdldc.model.DanhMucSoBanNganh"%>
<%@page import="qldc.pm.qtht.dmdc.model.DanToc"%>
<%@page import="qldc.pm.qtht.dmdc.service.DanTocLocalServiceUtil"%>
<%@page import="qldc.pm.qtht.dmdc.service.TinhLocalServiceUtil"%>
<%@page import="qldc.pm.qtht.dmdc.model.Tinh"%>
<%@page import="qldc.pm.qtht.dmdc.utils.DiaChiUtils"%>
<%@page import="qldc.pm.csdl.cd90.service.CongDanDTOLocalServiceUtil"%>
<%@page import="qldc.pm.csdl.cd90.model.dto.CongDanDTO"%>
<%@ include file="../../init.jsp"%>

 <%

	long IDQLKT_NguoiDung  = ParamUtil.getLong(request, "IDQLKT_NguoiDung");
	NguoiDung nguoiDung = NguoiDungLocalServiceUtil.fetchNguoiDung(IDQLKT_NguoiDung);
	List<Tinh> tinhs = TinhLocalServiceUtil.findAll();
	List<DanhMucSoBanNganh> danhMucSoBanNganhs = DanhMucSoBanNganhLocalServiceUtil.searchAll();
	List<DanToc> danTocs = DanTocLocalServiceUtil.findAll();
	
	long tinhId = nguoiDung.getIDTinhThuongTru();
	long quanHuyenId = nguoiDung.getIDQuanHuyenThuongTru();
	long phuongXaId =  nguoiDung.getIDPhuongXaThuongTru();
%>
<portlet:resourceURL var="loadQuanHuyen" id="loadQuanHuyen">
	<portlet:param name="tinhIdSelected" value="{0}" />
</portlet:resourceURL>

<portlet:resourceURL var="loadPhuongXa" id="loadPhuongXa">
	<portlet:param name="quanHuyenIdSelected" value="{0}" />
</portlet:resourceURL>
<div id="<portlet:namespace/>thong-tin-ca-nhan-content">
	<table class="gridnormal">
		<tr>
			<td>
				<liferay-ui:message key="so-ban-nganh" />
			</td>
			<td>
				<select class="" readonly="readonly"   id="<portlet:namespace/>soBanNganh"  name="<portlet:namespace/>soBanNganh">
					<option value="0"><liferay-ui:message key="chon-so-ban-nganh" /></option>
					<%
						for (DanhMucSoBanNganh danhMucSoBanNganh : danhMucSoBanNganhs) {
					%>
					<option value="<%=danhMucSoBanNganh.getIDQLKT_DanhMucSoBanNganh()%>" <%=danhMucSoBanNganh.getIDQLKT_DanhMucSoBanNganh() == nguoiDung.getIDQLKT_DanhMucSoBanNganh() ? "selected=selected" : ""%>><%=danhMucSoBanNganh.getTenSoBanNganh()%></option>
					<%
						}
					%>
				</select>
			</td>
			<td  colspan="2"/>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="ten-dang-nhap" />
			</td>
			<td>
				<input type="text" name="<portlet:namespace/>tenDangNhap" id="<portlet:namespace/>tenDangNhap" value="<%= nguoiDung.getTenDangNhap() %>" />
			</td>
			<td  colspan="2"/>
		</tr>
		
		<tr>
			<td>
				<liferay-ui:message key="ho-ten" />
			</td>
			<td>
				<input type="text"  name="<portlet:namespace/>hoTen" id="<portlet:namespace/>hoTen" value="<%= nguoiDung.getHoVaTen() %>" />
			</td>
			<td  colspan="2"/>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="so-cmnd" />
			</td>
			<td>
				<input type="text" name="<portlet:namespace/>soCMND" id="<portlet:namespace/>soCMND" value="<%=nguoiDung.getSoCMND() %>" />
			</td>
			<td  colspan="2"/>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="gioi-tinh" />
			</td>
			<td>
				<select class=""  id="<portlet:namespace/>gioiTinh"  name="<portlet:namespace/>gioiTinh">
					<option value="0" <%=nguoiDung.getGioiTinh() == 0 ? "selected=selected" : ""%>><liferay-ui:message key="nu" /></option>
					<option value="1" <%=nguoiDung.getGioiTinh() == 1 ? "selected=selected" : ""%>><liferay-ui:message key="nam" /></option>
				</select>
			</td>
			<td  colspan="2"/>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="dan-toc" />
			</td>
			<td>
				<select class=""  id="<portlet:namespace/>danToc"  name="<portlet:namespace/>dan-toc">
					<option value="0"><liferay-ui:message key="chon-dan-toc" /></option>
					<%
						for (DanToc danToc : danTocs) {
					%>
					<option value="<%=danToc.getDanTocId()%>" <%=danToc.getDanTocId() == nguoiDung.getDanToc() ? "selected=selected" : ""%>><%=danToc.getTenDanToc()%></option>
					<%
						}
					%>
				</select>
			</td>
			<td  colspan="2"/>
		</tr>
		<tr>
			<td>
				<liferay-ui:message key="dc-thuong-tru" />
			</td>
			<td colspan="3">
				<select class=""  id="<portlet:namespace/>tinh"  name="<portlet:namespace/>tinh"
					onchange="loadNewQuanHuyen('<portlet:namespace />','<%=loadQuanHuyen.toString()%>',<%=quanHuyenId%>,'tinh','quanHuyen', 'phuongXa');">
					<option value="0"><liferay-ui:message key="chon-tinh" /></option>
					<%
						for (Tinh tinh : tinhs) {
					%>
					<option value="<%=tinh.getTinhId()%>"
						<%=tinh.getTinhId() == tinhId ? "selected=selected" : ""%>><%=tinh.getTenTinh()%></option>
					<%
						}
					%>
				</select>
				<select class=""  id="<portlet:namespace/>quanHuyen"  name="<portlet:namespace/>quanHuyen" 
						onchange="loadNewPhuongXa('<portlet:namespace />','<%=loadPhuongXa.toString()%>',<%=phuongXaId%>,'tinh','quanHuyen', 'phuongXa');">
					<option value="0"><liferay-ui:message key="chon-quan-huyen" /></option>
				</select>
				<select class=""  id="<portlet:namespace/>phuongXa"  name="<portlet:namespace/>phuongXa">
					<option value="0"><liferay-ui:message key="chon-phuong-xa" /></option>
				</select>
				<input type="text" name="<portlet:namespace/>diaChi" 
						id="<portlet:namespace/>diaChi" value="<%= nguoiDung.getDiaChiThuongTru() %>" />
			</td>
		</tr>
		<tr>
			<td>
				<liferay-ui:message key="giai-thich" />
			</td>
			<td colspan="3">
				<textarea rows="5" cols="150" name="<portlet:namespace/>giaiThich" 
						id="<portlet:namespace/>giaiThich" value="<%= Validator.isNotNull(nguoiDung.getChuThich()) ? nguoiDung.getChuThich() :"" %>">
				</textarea>
			</td>
		</tr>
	</table>
</div>

<script type="text/javascript">
$(document).ready(function() {	
	loadNewQuanHuyen('<portlet:namespace />','<%=loadQuanHuyen.toString()%>',<%=quanHuyenId%>,'tinh','quanHuyen', 'phuongXa');
	loadNewPhuongXa('<portlet:namespace />','<%=loadPhuongXa.toString()%>',<%=phuongXaId%>,'tinh','quanHuyen', 'phuongXa');
});


</script>